package xiancheng.daemon;

import javax.swing.*;

/**
 * @author Mr.ma
 * @since 2022/11/1 15:47
 **/
public class Test08 {
    public static void main(String[] args) {
        TestRunnable04 testRunnable04 = new TestRunnable04();
        Thread thread = new Thread(testRunnable04);
        thread.setName("守护线程");
        thread.setDaemon(true);
        thread.start();
        for (int i = 0; i < 200; i++) {
            System.out.println("main ===== " + i);
        }
    }
}
class TestRunnable04 implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 200; i++) {
            System.out.println(Thread.currentThread().getName() + " ==== " + i);
        }
    }
}
